package com.ima.web.account.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.ima.web.beans.form.StoriesForm;
import com.ima.web.service.CategoriesService;

@Controller
public class StoryManagementController {

	private CategoriesService categoriesService;

	@Autowired
	public void setDepencies(CategoriesService categoriesService){
		this.categoriesService = categoriesService;
	}
	
	@RequestMapping("/account/story/create")
	public String createStory(ModelMap map){
		map.put("story", new StoriesForm());
		map.put("categories",categoriesService.getApproved());
		
		return "user/createStory";
	}
}
